public class Numbers
{
   /**
      Combines two numbers with a given operator.
      @param op one of "+", "-", "*", "/", or "^" (for power)
      @param first the first argument
      @param second the second argument
      @return the result of evaluating the operator with the arguments
   */
   public static double evaluate(String op, double first, double second)
   {
      double s;
      if(op.equals("+")){
         s=first+second;
      }else if(op.equals("-")){
         s=first-second;
      }else if(op.equals("*")){
         s=first*second;
      }else if(op.equals("/")){
         s=first/second;
      }else{
         s=Math.pow(first,second);
      }
      return s;
   }
}
